//
//  MultiviewViewController.m
//  Multiview
//
//  Created by Jeffrey Berthiaume on 4/11/09.
//  Copyright pushplay.net 2009. All rights reserved.
//

#import "MultiviewViewController.h"
#import "WelcomeViewController.h"
#import	"MenuViewController.h"
#import	"TestModeViewController.h"
#import "PracticeModeViewContoller.h"
#import	"HangmanModeViewController.h"

@implementation MultiviewViewController

UIViewController  *currentView;

- (void) displayView:(int)intNewView {
	NSLog(@"%i", intNewView);
	[currentView.view removeFromSuperview];
	[currentView release];
	switch (intNewView) {
		case 1:
			currentView = [[WelcomeViewController alloc] init];
			break;
		case 2:
			currentView = [[MenuViewController alloc] init];
			break;
		case 3:
			currentView = [[TestModeViewController alloc] init];
			break;
		case 4:
			currentView = [[PracticeModeViewContoller alloc] init];
			break;
		case 5:
			currentView = [[HangmanModeViewController alloc] init];
			break;	
		
	}
	
	[self.view addSubview:currentView.view];
}


- (void)viewDidLoad {
	// display Welcome screen
	currentView = [[WelcomeViewController alloc] init];
	[self.view addSubview:currentView.view];

    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
	[currentView release];
    [super dealloc];
}

@end
